package small.common.designPattern.behavioral.observer.subscriber;

import small.common.designPattern.behavioral.observer.event.Event;

import java.util.concurrent.Executor;

/**
 * @author jinzhou
 * @data 2023/5/9 17:57
 */
public interface Subscriber <T extends Event>{

    /**
     * 监听事件
     * @param event
     */
    void onEvent(T event);

    /**
     * 是否匹配事件
     * @param event
     * @return
     */
    boolean scopeMatches(Event event);

    /**
     * 线程池
     * @return
     */
    Executor executor();
}
